import { defHttp } from '/@/utils/http/axios';
import { IPostDeptsUpdateRaw } from '/@/types/system/senior/depts/update';
import { IPostDeptsAddRequest } from '/@/types/system/senior/depts/add';
import { IGetDeptsDropdownResponse } from '/@/types/system/senior/depts/dropdown';
import { IPostDeptsQueryRequest, IPostDeptsQueryResponse } from '/@/types/system/senior/depts/query';
import { IGetRawDeptsDetailsResponse } from '/@/types/system/senior/depts/details';

/**
 * 修改部门
 */
export const apiPostDeptsUpdatePath = (deptId: string | number, params: IPostDeptsUpdateRaw) =>
  defHttp.post({ url: `/system/senior/depts/update/${deptId}`, params });
/**
 * 删除部门
 */
export const apiGetDeptsDeletePath = (deptId: string | number) => defHttp.get({ url: `/system/senior/depts/delete/${deptId}` });
/**
 * 新增部门
 */
export const apiPostDeptsAdd = (params: IPostDeptsAddRequest) => defHttp.post({ url: `/system/senior/depts/add`, params });
/**
 * 获取部门树级结构
 */
export const apiGetDeptsDropdown = () => defHttp.get<IGetDeptsDropdownResponse>({ url: `/system/senior/depts/dropdown` });
/**
 * 部门列表
 */
export const apiPostDeptsQuery = (params: IPostDeptsQueryRequest) =>
  defHttp.post<IPostDeptsQueryResponse>({ url: `/system/senior/depts/query`, params });
/**
 * 部门详情
 */
export const apiGetDeptsDetailsPath = (deptId: string | number) =>
  defHttp.get<IGetRawDeptsDetailsResponse>({ url: `/system/senior/depts/details/${deptId}` });
